package com.hebeiwangxiaozhang.admin.testing;

import com.hebeiwangxiaozhang.admin.feign.ProductServiceClient;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestingService {

    @Autowired
    TestingRepo testingRepo;

    @Autowired
    ProductServiceClient productServiceClient;

    @GlobalTransactional
    public void testing() {
        testingRepo.save(TestingTable.builder().name("tom").build());
        // 调用其他服务
        productServiceClient.testing();
    }
}
